package com.vanke.gankclient.view

import android.content.Context
import android.support.v4.view.ViewPager
import android.util.AttributeSet
import android.view.MotionEvent

/**
 * @name GankClient
 * @package name：com.vanke.gankclient.view
 * @class describe
 * @anthor shiyuchuan
 * @time 2017/8/10 15:45
 */
class  NoScrollViewPager : ViewPager{

    private val  isPagingEnable = false

    constructor(context: Context) : super(context){}

    constructor(context: Context, attributeSet: AttributeSet) : super(context,attributeSet){}

    override fun onTouchEvent(ev: MotionEvent?): Boolean {
        return this.isPagingEnable && super.onTouchEvent(ev)
    }

    override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean {
        return this.isPagingEnable && super.onInterceptTouchEvent(ev)
    }

    override fun scrollTo(x: Int, y: Int) {
        super.scrollTo(x, y)
    }
}